package com.zz.routing;

import com.zz.ProviderApplication;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.amqp.rabbit.core.RabbitTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

/**
 * @Author zwh
 * @Date 2019/10/2 10:40
 * @Version 1.0
 **/
@RunWith(SpringRunner.class)
@SpringBootTest(classes = ProviderApplication.class)
public class Routing {

    @Autowired
    private RabbitTemplate rabbitTemplate;

    @Test
    public void test() {
            rabbitTemplate.convertAndSend("routing", "error", "ads1打error");
            rabbitTemplate.convertAndSend("routing", "info", "ads1打info");
    }
}
